package cz.muni.fi.pb138.avradiation.parser;

import cz.muni.fi.pb138.avradiation.Sensor.Sensor;
import java.io.File;
import java.io.InputStream;
import java.util.Collection;

/**
 * Describes which methods should parser implement to be compatible with other
 * parts of program. Especially with storage part.
 * 
 * @author Andrej Kuročenko <kurochenko@gmail.com>
 */
public interface Parser {
    
    /**
     * Parses CSV file specified by <code>pathToCSV</code>, extracts sensors and 
     * measured values into collection.
     * 
     * @param   pathToCSV   path to CSV file to parse
     * @return              collection of parsed sensors and it's values
     */
    public Collection<Sensor> parse(String pathToCSV);
    
     /**
     * Parses specified CSV file, extracts sensors and measured values into 
     * collection.
     * 
     * @param   CSVFile     CSV File to parse
     * @return              collection of parsed sensors and it's values
     */
    public Collection<Sensor> parse(File CSVFile);
    
    /**
     * Parses input stream <code>is</code>, extracts sensors and measured values 
     * into collection. Sensors location will be set to "Not Specified"
     * 
     * @param   is      Input stream to parse
     * @return          collection of parsed sensors and it's values
     */
    public Collection<Sensor> parse(InputStream is);
    
    /**
     * Parses input stream <code>is</code>, extracts sensors and measured values 
     * into collection.
     * 
     * @param   is          Input stream to parse
     * @param   location    Name of sensors location
     * @return              collection of parsed sensors and it's values
     */
    public Collection<Sensor> parse(InputStream is, String location);
}
